﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminFunction.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="BitPortal.Admin.Feedback.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TopBarHolder" runat="server">
    <ext:ButtonGroup ID="ButtonGroup1" runat="server" Layout="ToolbarLayout">
        <Items>
            <ext:Button runat="server" ID="btnView" Text="Xem chi tiết" Icon="Report" Scale="Medium"
                CausesValidation="false">
                <DirectEvents>
                    <Click OnEvent="btnView_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:Button runat="server" ID="btnReplySelected" Text="Trả lời" Icon="ArrowRedo" Scale="Medium"
                CausesValidation="false">
                <DirectEvents>
                    <Click OnEvent="btnReplySelected_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:SplitButton runat="server" ID="btnUpdate" Text="Đánh dấu" Icon="Pencil" Scale="Medium">
                <Menu>
                    <ext:Menu ID="Menu1" runat="server">
                        <Items>
                            <ext:MenuItem ID="MenuItem1" runat="server" Text="Đã trả lời" Icon="FlagYellow">
                                <DirectEvents>
                                    <Click OnEvent="btnMarkAsReplied_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                            <ext:MenuItem ID="btnMarkAsUnreplied" runat="server" Text="Chưa trả lời" Icon="FlagWhite">
                                <DirectEvents>
                                    <Click OnEvent="btnMarkAsUnreplied_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                        </Items>
                    </ext:Menu>
                </Menu>
            </ext:SplitButton>
            <ext:ToolbarSeparator />
            <ext:Button runat="server" ID="btnDelete" Text="Xóa" Icon="Delete" Scale="Medium">
                <DirectEvents>
                    <Click OnEvent="btnDelete_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:ToolbarSeparator />
            <ext:SplitButton runat="server" ID="btnTrash" Text="Thùng rác" Icon="Bin" Scale="Medium">
                <Menu>
                    <ext:Menu ID="Menu2" runat="server">
                        <Items>
                            <ext:MenuItem ID="MenuItem8" runat="server" Text="Xóa tất cả" Icon="Cancel">
                                <DirectEvents>
                                    <Click OnEvent="btnTrashEmpty_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                            <ext:MenuItem ID="MenuItem9" runat="server" Text="Xóa những bài được chọn" Icon="BinEmpty">
                                <DirectEvents>
                                    <Click OnEvent="btnTrashDelete_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                            <ext:MenuItem ID="MenuItem10" runat="server" Text="Bỏ khỏi thùng rác" Icon="ArrowTurnLeft">
                                <DirectEvents>
                                    <Click OnEvent="btnUnDelete_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                        </Items>
                    </ext:Menu>
                </Menu>
                <DirectEvents>
                    <Click OnEvent="btnTrash_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:SplitButton>
        </Items>
    </ext:ButtonGroup>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData" RemoteSort="true"
        RemotePaging="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="FeedbackID">
                <Fields>
                    <ext:RecordField Name="FeedbackID" Type="Auto" />
                    <ext:RecordField Name="Subject" Type="String" />
                    <ext:RecordField Name="SenderEmail" Type="String" />
                    <ext:RecordField Name="SenderName" Type="String" />
                    <ext:RecordField Name="IsReplied" Type="Boolean" />
                    <ext:RecordField Name="DatetimeSend" Type="Date" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="limit" Value="10" Mode="Raw" />
            <ext:Parameter Name="sort" Value="" />
            <ext:Parameter Name="dir" Value="" />
        </BaseParams>
        <SortInfo Field="FeedbackID" Direction="DESC" />
    </ext:Store>
    <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true" Title="Danh sách liên hệ"
        StoreID="Store1">
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column Header="Mã" DataIndex="FeedbackID" Groupable="false" Width="20" Align="Center" />
                <ext:Column Header="Tiêu đề" DataIndex="Subject" Groupable="false" />
                <ext:Column Header="Tên người gửi" DataIndex="SenderName" />
                <ext:Column Header="Email người gửi" DataIndex="SenderEmail" />
                <ext:Column Header="Đã trả lời" DataIndex="IsReplied" Align="Center" Width="30">
                    <Renderer Handler="return (value) ? 'Đã trả lời':'Chưa trả lời';" />
                </ext:Column>
                <ext:DateColumn Header="Ngày gửi" DataIndex="DatetimeSend" Align="Center" Format="dd-MM-yyyy"
                    Width="40" />
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
        </SelectionModel>
        <View>
            <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" MarkDirty="false"
                ShowGroupName="true" EnableNoGroups="true" HideGroupedColumn="true" ShowGroupsText="Nhóm lại theo cột này" />
        </View>
        <LoadMask ShowMask="true" />
        <Plugins>
            <ext:GridFilters runat="server" ID="GridFilters1">
                <Filters>
                    <ext:NumericFilter DataIndex="FeedbackID" />
                    <ext:StringFilter DataIndex="Subject" />
                    <ext:StringFilter DataIndex="SenderName" />
                    <ext:StringFilter DataIndex="SenderEmail" />
                    <ext:DateFilter DataIndex="DatetimeSend">
                        <DatePickerOptions runat="server" TodayText="Now" />
                    </ext:DateFilter>
                    <ext:BooleanFilter DataIndex="IsReplied" />
                </Filters>
            </ext:GridFilters>
        </Plugins>
        <BottomBar>
            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" />
        </BottomBar>
    </ext:GridPanel>
    <uc:FeedbackDetail runat="server" ID ="FeedbackDetail1" />
    <uc:ReplyFeedback runat="server" ID="ReplyFeedback1" />
</asp:Content>
